Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support catalog for Spark Snowflake #432

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

zhaohehuhu
Copy link

No description provided.

Copy link
Contributor

@sfc-gh-mrui sfc-gh-mrui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luoyedeyi Thanks for your contribution on the spark connector. Left some comments for this PR. Could you please take a look?

@@ -0,0 +1,29 @@
name: Snyk Issue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file sounds not related to this PR.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@@ -0,0 +1,31 @@
name: snyk-pr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file sounds not related to this PR.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

import scala.collection.convert.ImplicitConversions.`map AsScala`
import scala.collection.mutable.ArrayBuilder

class SfCatalog extends TableCatalog with Logging with SupportsNamespaces{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please check the scala style with sbt scalastyle?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

import scala.collection.convert.ImplicitConversions.`map AsScala`
import scala.collection.mutable.ArrayBuilder

class SfCatalog extends TableCatalog with Logging with SupportsNamespaces{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks SfCatlog will work as a utility class for Spark Connector user correct?
Can you add some unit test and integration test for it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

ident: Identifier,
schema: StructType,
partitions: Array[Transform],
properties: java.util.Map[String, String]): Table = ???
Copy link
Contributor

@sfc-gh-mrui sfc-gh-mrui Aug 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??? sounds misleading. If you think the interface functions are not applicable for Spark Connector, I just you throw an UnsupportedOperationException
This comment applied to the other similar cases.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

import org.apache.spark.sql.types.StructType
import org.apache.spark.sql.{Row, SQLContext}

case class SfScan(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain how SfScan/SfScanBuilder/SfWriteBuilder/SfTable are used.
They are defined in this PR but I don't understand when and how they are used?
Could you please add some test cases for them?

Copy link
Author

@zhaohehuhu zhaohehuhu Aug 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Just wanna implement some datasource interfaces already inside Spark to enable reading and sinking data on Snowflake by catalog.

writer.save(data.sqlContext, data, saveMode, params)
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add empty line in the end of the file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@zhaohehuhu
Copy link
Author

I refactored the code and please review it @sfc-gh-mrui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants